
<template>
  <div class="home_container">
    <header class="headerTitle">页面载入状态</header>

    <div
      class="uaContainer"
      v-html="ua + '<br/>' + 'document.readyState:' + domReadyState"
    ></div>

    <div class="sectionHeaderContainer">{{sectionHeadTitle}}</div>
    <!-- 折叠 -->
    <accordion
      v-for="(item, index) in dataList"
      :key="index"
      :title="item"
      :list="item.child"
      :sectionIndex=index>
    </accordion>

  </div>
</template>


<script>

import Accordion from "../baseComponent/qsaccordion";

import {mapState} from "vuex";

export default {
  name: "cordova插件",
  mounted() {
    
  },
  components:{
    Accordion
  },

  // computed : mapState({

  //   // 直接获取
  //   // allTime : state => state.allTime,

  //   // 传字符串参数 allTime， 等同于 'state' => state.allTime
  //   allTime: 'allTime',

  //   // 为了能够使用this，获取局部变量，必须引入常规函数
  //   countPlusLocalState(state){
  //     return state.allTime + this.localCount
  //   },
  // }),


  computed : {
    ...mapState({
    })
  },

  created() {
    this.$store.commit('INITIALIZE_DATA');
  },

  data() {
    console.log(this.$store.state);
    return {
      ua: window.navigator.userAgent,
      domReadyState: window.document.readyState,
      sectionHeadTitle : 'cordova Plugin',
      // localCount : 100,
      dataList:[
          {"area":"通用接口","child":[
            {'name':'开启页面下拉刷新','method':'base_addPullToRefresh'},
            {'name':'收起页面下拉刷新','method':'base_finishPullToRefresh'},
            {'name':'移除页面下拉刷新','method':'base_removePullToRefresh'},

            {'name':'显示原生loading','method':'base_startLoading'},
            {'name':'关闭原生loading','method':'base_stopLoading'},
            {'name':'判断是否安装某app','method':'base_phoneIsExistApp'},
            {'name':'监听Android物理返回键','method':'base_listenBackButton'},
  
            {'name':'驾车导航','method':'startNavigate'},
            {'name':'获取页面可见状态','method':'getPageVisibilityState'},
        
            {'name':'通知原生登录成功','method':'account_loginSuccess'},
            {'name':'通知原生登出成功','method':'account_logoutSuccess'},
            {'name':'使用第三方授权登录','method':'account_appSocialSnsLogin'},
            
            {'name':'保存图片到相册','method':'base_saveToAlbum'},
            {'name':'跳转到图片浏览页','method':'imageviewer'},
            
            {'name':'设置状态栏样式','method':'base_setStatusColor'},
            {'name':'发送一个原生通知','method':'postNotice'},
            {'name':'通用H5回调原生','method':'base_h5ServicesCallback'},

            {'name':'以游客模式进入首页(app破墙之后去除)','method':'jump_goVisitor'},
            {'name':'H5通过客户端进行网络请求','method':'fetchData'},
            
            {'name':'返回到首页指定页面','method':'base_backToHome'},
            {'name':'返回到上一页','method':'base_backToPreviousPage'},
            {'name':'H5调用原生返回n页','method':'base_goBackPage'},
            {'name':'H5销毁指定url页面','method':'base_destroyPage'},
            {'name':'底部弹窗','method':'base_showNativeActionSheet'},
            {'name':'iOS引导APPStore评价','method':'base_rate'},
            {'name':'安卓去评价','method':'appRate'},
            {'name':'选择图片上传(安卓)','method':'base_pickPhoto'},
            {'name':'扫码功能','method':'native_scan'}]},
            
            
          {"area":"本地存储","child":[
            {'name':'设置原生本地存储','method':'base_localStorageSetItem'},
            {'name':'获取原生本地存储','method':'base_localStorageGetItem'},
            {'name':'清除共用的存储空间','method':'base_localStorageClean'},
            {'name':'清除某key的存储空间','method':'base_localStorageRemoveItem'},
            {'name':'获取公用的存储空间','method':'base_localStorageAllItems'}
          ]},
          {"area" :'小程序',"child":[
            {'name': '打开小程序' , 'method':'openMiniProgram'}
          ]},
          {"area" :'支付相关',"child":[
            {'name':'原生支付','method':'nativePay'},
            {'name':'微信app支付(安卓)','method':'pay_startWechatPay'},
            {'name':'检查支付平台是否存在','method':'pay_checkoutPlatform'},
          ]},
           {"area" :'设备信息及app信息相关插件',"child":[
            {'name':'获取设备型号','method':'getPhoneModel'},
            {'name':'获取app版本号','method':'getAppVersion'},
            {'name':'获取系统版本','method':'getSystemVersion'},
            {'name':'获取设备mac(仅Android)','method':'getMac'},
            {'name':'处理安卓滑动冲突','method':'ui_scrollHorizontalRect'},
          ]},
           {"area" :'zuzuche聊天相关',"child":[
            {'name': '清除输入内容' , 'method':'chat_cleanInputText'},
            {'name':'输入内容正则匹配', 'method' : 'receiveSearchReg'},
            {'name':'控制键盘初始状态','method':'userVisitorMode'},
            {'name':'控制聊天输入框切换的状态','method':'chat_switchInputToolStatus'},
            {'name':'打开输入法(安卓)','method':'base_openKeyboard'},
            {'name':'iOS聊天收起键盘','method':'appTextResignFirstResponder'},
          ]},
           {"area" :'省钱宝及剪贴板插件',"child":[
            {'name':'显示原生省钱宝弹窗','method':'fectchSqbSuperDialog'},
            {'name':'给剪贴板赋值插件','method':'base_setNativeClipboard'},
            {'name':'获取剪贴板内容','method':'base_getNativeClipboard'},
          ]},
          {"area":"原生UI","child":[
            {'name':'导航栏右侧浮出菜单','method':'base_navbarRightPopover'},
            {'name':'调用原生Toast','method':'base_toast'},
            {'name':'webview滑动回顶部','method':'backToTop'},
            {'name': 'reload重新加载网页', 'method':'base_reloadWebView'},
            {'name': '隐藏三张电子卡', 'method':'hiddenPayCard'},

            {'name':'显示或者隐藏导航栏','method':'base_showNavigationBar'},
            {'name':'控制界面滑动返回手势(iOS)','method':'base_controlLeftPanGesture'},
            {'name':'设置页面标题','method':'base_webviewTitle'},
            {'name':'置顶部导航栏的淡入淡出效果(iOS)','method':'base_setTopNavbarFadeIn'},
            {'name':'设置当前导航栏右侧按钮','method':'base_navbarRightButtons'},
            {'name':'设置当前导航栏左侧按钮(iOS)','method':'base_navbarLeftButtons'},
            {'name':'自定义左侧返回按钮(只安卓)','method':'base_customNavbarLeftButton'},
            {'name':'自定义导航栏右侧按钮','method':'base_customNavbarRightButton'},
            {'name':'顶部导航右侧功能按钮弹窗(只Android)','method':'appCustomRightBarList'},
            {'name':'设置当前导航栏按钮的显示隐藏(iOS)','method':'base_setTopBackBtnState'},
            

			      {'name':'添加桌面快捷方式(只Android)','method':'addShortcut'},
			      {'name':'处理横向滑动冲突(只Android)','method':'ui_scrollHorizontalRect'},
            
          ]},
          {"area":"广告插件","child":[
            {'name':'加载激励视频广告事件','method':'playRewardAdVideo'},
            {'name':'加载banner广告事件','method':'showBannerAd'},
            {'name':'关闭banner广告事件','method':'dismissBannerAd'},
            {'name':'加载信息流feed广告事件','method':'showFeedAd'},
            {'name':'关闭信息流feed广告事件','method':'dismissFeedAd'},
            {'name':'头条视频广告','method': 'showDrawVideo'},
            {'name':'头条信息流广告','method':'showNews'},
            {'name':'阅盟广告','method':'showYmNovel'}
          ]},
          {'area' : 'CPS业务',"child":[
            {'name':'打开京东主站页面','method':'jd_openAppWebViewPage'},
            {'name':'跳转京东购物车','method' :'fectchShoppingCartPage'},
            {'name':'拉取CPS订单数据', 'method' : 'fetch_orderData'},
            {'name':'上报无返现商品详情申请', 'method' :'apply_orderData'},
            {'name':'获取阿里百川授权','method':'alibc_login'},
            {'name':'百川插件跳转到淘宝','method':'showAli_TradePage_New'},
            {'name':'表示是否已经授权淘宝登录','method':'alibc_isLogin'}
          ]},
            {"area":"豹趣小游戏","child":[
            {'name':'开启小游戏页面','method':'openGamePage'},
          ]},
          {'area' : '推a',"child":[
            {'name' : '跳转推啊界面','method' :'tuiAFetchCustomAd'}
          ]},
          {'area' : '日历',"child":[
            {'name' : '添加日历提醒','method' :'saveContentToCalendar'},
            {'name' : '移除日历提醒','method' :'removeContentFromCalendar'},
            {'name' : '检测是否在日历中','method' :'checkContentInCalendar'},
          ]},
           {'area' : '应用权限相关',"child":[
            {'name' : '检查权限','method' :'native_hasPermissions'},
            {'name' : '请求权限','method' :'native_requestPermissions'},
            {'name' : '跳转权限设置页面','method' :'jump_permission_setting'},
            {'name' :'获取用户通信录信息', 'method' :'requestUserContactBook'},
            {'name' :'添加通信录联系人信息', 'method' :'addUserContact'},
            {'name':'请求位置信息返回定位数据(安卓)','method':'base_requestLocation_new'},
            {'name':'请求位置信息返回定位数据(iOS)','method':'base_requestLocation'},
          ]},
          {'area' : '音视频',"child":[
            {'name' : '抖券原生播放视频广告','method' :'native_playItem'},
          ]},
          {'area' : '登录用户信息相关',"child":[
            {'name' : '拉起原生登录','method' :'jumpLogin'},
            {'name' : '更新用户信息','method' :'updateUserInfo'},
            {'name':'获取用户信息','method':'account_getInfo'},
          ]},
          {"area":"热云统计trackingIO","child":[
            {'name':'报送应用注册事件','method':'trackingIO_registerAccount'},
            {'name':'报送应用登录事件','method':'trackingIO_loginAccount'},
            {'name':'开始支付行为上报','method':'trackingIO_startPay'},
            {'name':'支付行为成功上报','method':'trackingIO_finishPay'},
            {'name':'用户任意行为上报','method':'trackingIO_setEvent'},
            {'name':'trackingIO设置属性','method':'trackingIO_setProfile'},
          ]},
           {'area' : 'growingIO插件',"child":[
            {'name' : '上报growingIO事件','method' :'growingIO'},
          ]},
            {'area' : '分享插件',"child":[
            {'name' : 'wx小程序分享','method' :'shareWxMiniProgram'},
            {'name':'分享接口','method':'base_share'},
          ]},
        ]
    };
  },
};
</script>


<style lang="less" scoped>
.home_container {
  display: flex;
  flex-direction: column;
  width: 100vw;
}

.headerTitle {
  text-align: center;
  color: 0x333333;
  font: 14px medium;
  margin-top: 15px;
}

.uaContainer {
  margin: 10px 10px 0px 10px;
  padding: 10px;
  font-size: 13px;
  word-wrap: break-word;
  border: 1px mediumseagreen solid;
  line-height: 24px;
}

.sectionHeaderContainer{
  display: flex;
  align-self: center;
  margin-top: 20px;
  font-size: 14px;
  font-weight: 800;
}

.vuexClass{
  height: 88px;
  background-color:blanchedalmond;
  margin-top: 20px;
}
</style>